# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=py3-zulip
_pkgname=python-zulip-api
pkgver=0.8.2
pkgrel=0
pkgdesc="Zulip API bindings"
url="https://github.com/zulip/python-zulip-api/"
arch="noarch"
license="Apache-2.0"
depends="py3-requests py3-distro py3-openssl py3-typing-extensions"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-pytest-runner"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/zulip/python-zulip-api/archive/$pkgver.tar.gz
	disable-matrix_bridge.patch"
builddir="$srcdir/$_pkgname-$pkgver/zulip"

prepare() {
	default_prepare
	rm -rf integrations/bridge_with_matrix # FIXME: when upstream use matrix-nio
}

build() {
	python3 setup.py build
}

check() {
	py.test-3
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	install -Dm0644 README.md -t "$pkgdir"/usr/share/doc/"$pkgname"
	install -Dm0644 ../LICENSE -t "$pkgdir"/usr/share/doc/"$pkgname"
}

sha512sums="9128a4171097217469e08e6f355575bac632a00a694d7ebfada5d45312367ccf750ba91f04315c54d0c1082e83f1baaba7dda0fcecb050fdff960ae083c65d81  py3-zulip-0.8.2.tar.gz
9db34d936e8de3927104120aa5d254434582882680b9b4309e84ad7bc850fb5a4e0cfa1edd880ecd264dd9ecc5d75e066afc6d31b2ac3802501b8e150273bee6  disable-matrix_bridge.patch"
